import {reactive, ref} from 'vue'
import {messageInfo} from '@/utils/commonUtil'

export const useDog = () => {

	const dogName = ref('长江七号')
	const dogAge = ref(5)
	const dogGender = ref(1)
	const dogBirthday = reactive([2019, 5, 23])

	const printName = () => {
		messageInfo(dogName.value)
	}

	const addAge = (value?: number) => {
		dogAge.value += (value || 1)
	}

	return {
		dogName,
		dogAge,
		dogGender,
		dogBirthday,
		printName,
		addAge
	}
}
